package com.youthburin.base.spring;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

import com.youthburin.base.util.DwzPagination;
import com.youthburin.base.util.DwzUtils;

/**
 * 初始化分页对象
 * 
 * @author ex_liwei
 * 
 */
public class DwzPaginationInterceptorAdapter extends HandlerInterceptorAdapter {
	@Override
	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
		DwzPagination dwzPagination = DwzUtils.createDwzPagination(request);
		request.setAttribute(DwzPagination.DWZPAGINATION_PROPERTY_KEY, dwzPagination);
		return super.preHandle(request, response, handler);
	}
}
